<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Cache管理系统</title>
    <script src="js/base.min.js"></script>
    <script src="js/handlebars.min.js"></script>
    <script src="js/sea.min.js"></script>
    <!-- <link href="http://apps.bdimg.com/libs/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet"> -->
    <link href="css/bootstrap.css" rel="stylesheet">
    <link href="css/bootstrap_alter.css" rel="stylesheet">
    <link rel="stylesheet" href="css/combine.css">

    <!-- HTML5 shim IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="js/html5shiv.js"></script>
    <![endif]-->

</head>
<body class="loginbody">

    <div class="login">
        <div class="login-wrapper">
            <h1>登陆</h1>
            <form id="form">
                <div class="login-group">
                    <label for="loginName" class="iconfont">&#xe607;</label>
                    <input type="text" id="loginName"/>
                </div>
                <div  class="login-group">
                    <label for="loginPw" class="iconfont">&#xe608;</label>
                    <input type="password" id="loginPw"/>
                </div>
                <div class="login-save">
                    <input type="checkbox" id="loginSave" />
                    <label for="loginSave">记住密码</label>
                </div>
                <input type="submit" class="login-submit" value="登录">
            </form>
        </div>
        <p class="copyright"> Copyright © 2014-2020  中国移动通信有限公司All Rights Reserved.</p>
        <p class="copyright">Powerd By 东方网信有限公司.(版本号:cdn_webcache_V1.5)</p>
    </div>
    <script src="js/combine.js"></script>
    <script type="text/javascript">
        // console.log($.cookie('netEast'));
        // if($.cookie('netEast')){
        //     window.location.href="index.html";
        // }
        define('login', function(require){
            var base = require('global').base;
            $('#form').on('submit',function(e){
                e.preventDefault();
                $.ajax({
                    type:"post",
                    url: base + '/ApiSystem/userLogin',
                    dataType:'json',
                    data:{"UserName":$('#loginName').val(),"PassWord":$('#loginPw').val()},
                    success:function(data){
                        if(data.code==1){
                            //设置cookie
                            // $.cookie('netEast',JSON.stringify(data.info));
                            window.location.href="index.html"; 
                        }else if(data.code==0){
                            alert(data.message);
                        }
                    }
                });
            });
        });
        seajs.use('login');
    </script>
</body>
</html>